﻿<!DOCTYPE html>

<html class="x-admin-sm">
<head>
    <meta name="viewport" content="width=device-width" />
    <meta charset="UTF-8">
    <title>计划用料（无码）</title>
    <meta name="renderer" content=padding>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link href="~/js/layui/css/layui.css" rel="stylesheet" />
    <link href="~/X-admin/css/font.css" rel="stylesheet" />
    <script src="~/X-admin/lib/layui/layui.js"></script>
    <link href="~/X-admin/css/xadmin.css" rel="stylesheet" />
    <script src="~/X-admin/js/jquery.min.js"></script>
    <script src="~/X-admin/js/xadmin.js"></script>
    <script src="~/Scripts/formSelect/multiSelect.js"></script>
    <script src="~/js/framework/sysframework.js"></script>
    <script src="~/js/framework/commonjs.js"></script>
    <script src="~/js/sysweb/planjs.js"></script>
    <script type="text/html" id="barDemo">
        <a title="编辑用料" href="javascript:;"  lay-event="edit" id="frmEdit" ><i class="layui-icon">&#xe61f;</i></a>
    </script>
</head>
<body>
    <div class="layui-fluid" style="width:100%;">
        <div id="bDiv">
        </div>
        <div style="float:left;width:100%;">
            <div class="layui-card" >

                <div class="layui-card-body" style="margin-top:5px">
                    <form class="layui-form layui-col-space5" name="qForm" id="qForm">
                        <div class="layui-inline layui-show-xs-block">
                            <input type="text" name="plCode" placeholder="计划编码" autocomplete="off" class="layui-input" id="plCode">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <input type="text" name="erpOrder" placeholder="订单编码" autocomplete="off" class="layui-input" id="erpOrder">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <input type="text" name="proName" placeholder="存货名称" autocomplete="off" class="layui-input" id="proName">
                        </div>
                    </form>
                </div>

                <div class="layui-card-body layui-table-body layui-table-main" id="layui-table-main">
                    <table class="layui-hide" id="list" lay-filter="list"></table>
                </div>
            </div>


        </div>
    </div>
</body>
</html>

<script>
    var webCode = "";
    var selectList = new Array();

    $(function () {
        webCode = getUrlVariable("menuCode");
        BannerData(webCode, "bDiv");
        loadData();
    })
    function openQueryWin() {
        gjQuery=true;
        InfoOpenPage("../System/QueryWeb?webCode=" + webCode, "高级检索", "85%", "80%");
    }
  
    var cData = new Array();
    var dUrl = "../Plan/getDataList?dataType=pMUse&condition=";
    /**
     * 加载数据
     * **/
    function loadData(){

        if(!gjQuery){
            qStr = FormToJson("qForm");
        }

        gjQuery=false;
        layui.use('table', function () {
            var conditon = JSON.stringify(qStr);
            var table = layui.table;
            if (conditon.includes("#")) {
                conditon = conditon.replace(/\#/g, "%23");
            }
            table.render({
                elem: '#list'
                , height: 'full-200'   //固定高度-即固定表头固定第一行首行
                , cols: [[ //标题栏
                    {field: 'plCode', align: 'center', title: '计划编码', width: 120, sort: true }
                    , { field: 'erpOrder', align: 'center', title: '销售订单号', width: 120, sort: true }
                    , { field: 'proCode', align: 'center', title: '存货编码', width: 100 }
                    , { field: 'proName', align: 'center', title: '存货名称', width: 170 }
                    , { field: 'spec', align: 'center', title: '规格', width: 100 }
                    , { field: 'number', align: 'center', title: '生产数量', width: 100 }
                    , { field: 'cuName', align: 'center', title: '关联客户', width: 120 }
                    , { field: 'memo', align: 'center', title: '备注', width: 110 }
                    , { field: 'finishDate', align: 'center', title: '完成日期', width: 100 }
                    , { field: 'right', align: 'center', title: '数据操作', toolbar: '#barDemo', width: 90, fixed: 'right' }
                ]], done: function (res, curr, count) {
                    // $("[data-field='id']").css('display', 'none');//隐藏列
                    currPage = curr;
                    TablePowerHide();
                 
                }
                , url: dUrl + conditon
                , skin: 'row' //表格风格
                , even: true
                , page: true //是否显示分页
                , limits: [20, 25, 30]
                , limit: 20 //每页默认显示的数量
                , id: "list"
            });

            //监听工具条
            table.on('tool(list)', function (obj) {
                var data = obj.data;
                if (obj.event == 'edit') {

                    InfoOpenPage("../Plan/pMUseEdit?plCode=" + data.plCode+"&gxCode=" , "编辑计划用料", "85%", "80%", true);
                }
                else if (obj.event == 'view') {
                    //console.log("计划用料明细")
                }
              
            });

            /**复选框**/
            table.on('checkbox(list)', function (obj) {
                var select = new Array();
                plCode = "";
                var checkStatus = table.checkStatus('list');

                for (var i = 0; i < checkStatus.data.length; i++) {
                    select.push(checkStatus.data[i]);
                }
                cData = select;


            });

        });

    }

    var qStr="";
    /**
     * 获取高级查询字符串
     * **/
    function GetQueryPar(queryStr) {
      qStr=queryStr;
      loadData();
    }
    


</script>
